package com.liehu.user.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.liehu.user.pojo.Customer;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Repository
public interface CustomerMapper  extends BaseMapper<Customer> {
    //根据电话号码查询
    @Select("select id,mobile from tb_customer where mobile = #{mobile}")
    public Customer findByMobile(String mobile);
    @Select("select id,mobile,nick_name,gender,avatar from tb_customer where open_id = #{openId}")
    public  Customer findByOpenId(String openId);

    //修改密码--用于当前用户修改密码
    @Update("UPDATE tb_customer SET PASSWORD =  #{password} WHERE id = #{id}")
    public void updateByPassword(String id,String password);
}
